﻿@using System.Data;
@using System.Web;
@using DTcms.Web.MVC.Areas.Web.Controllers;
@using DTcms.Web.MVC.UI.Controllers;
@using DTcms.Model;
@{
   Layout = "~/Areas/Web/Views/" + ViewBag.TemplateSkin + "/web/Shared/_Layout.cshtml";
   DTcms.Model.channel_site site = ViewData["site"] as DTcms.Model.channel_site;
   DTcms.Model.siteconfig config = ViewData["config"] as DTcms.Model.siteconfig;
   BaseController bc = ViewBag.BasePage as BaseController;
   ViewBag.Title = "图片分享 - " + site.name;
   DataTable list = null;
   string channel = "photo";
   int count = 0;
   string pagelist = string.Empty;
}

<div class="section clearfix">
  <div class="line15"></div>
  <div class="wrapper clearfix">
    <div class="photo-list ilist">
      <ul>
        @{ 
        list = bc.get_article_list(channel, 0, 6, "status=0 and is_red=1");
        foreach(DataRow dr in list.Rows){
           count ++;
           <li class="col-@count">
             <a title="@dr["title"]" href="@bc.linkurl("photo_show",dr["id"])">
               <span class="abs-bg"></span>
               <span class="txt1">@dr["title"]</span>
               <span class="txt2">
                 <p>@dr["add_time"]</p>
               </span>
               <img src="@dr["img_url"]" />
             </a>
           </li>
        }
        }
      </ul>
    </div>
  </div>
</div>

<!--分类图片-->
@{ 
list = bc.get_category_child_list(channel,0);
foreach(DataRow dr in list.Rows){
<div class="section clearfix">
  <div class="ntitle">
    <h2>
      <a href="@bc.linkurl("photo_list",dr["id"])">@dr["title"]<em></em></a>
    </h2>
    <p>
      <!--小类-->
      @{ 
      DataTable categoryList = bc.get_category_child_list(channel,Convert.ToInt32(@dr["id"]));
      int count2 = 0;
      foreach(DataRow cdr in categoryList.Rows){
         count2 ++;
         if(count2==1){
         <a class="no-bg" href="@bc.linkurl("photo_list",dr["id"])">@dr["title"]</a>
         }else{
         <a href="@bc.linkurl("photo_list",dr["id"])">@dr["title"]</a>
         }
      }
      }
    </p>
  </div>
  <div class="wrapper clearfix">
    <ul class="img-list high ilist">
      @{ 
      DataTable articleList = bc.get_article_list(channel, Convert.ToInt32(dr["id"]), 5, "status=0");
      foreach (DataRow adr in articleList.Rows){
      <li>
        <a title="@adr["title"]" href="@bc.linkurl("photo_show",adr["id"])">
          <span class="abs-bg"></span>
          <span class="txt1">@dr["title"]</span>
          <span class="txt2">
            <i>阅读：@adr["click"]次</i>
            <p>@DateTime.Parse(adr["add_time"].ToString()).ToString("yyyy-MM-dd")</p>
          </span>
          <img src="@adr["img_url"]" />
        </a>
      </li>
      }
      }
    </ul>
  </div>
</div>
}
}